package star.cloud.asme.base.mail;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.MailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;

@Configuration
public class MailConfig {
    //    @Bean("qqMailSender")
    @Bean
    public MailSender mailSender() {
        JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
        mailSender.setHost("smtp.qq.com");
        mailSender.setPort(465);
        mailSender.setUsername("195288591@qq.com");
        mailSender.setPassword("zjmbqnbvlvgbcbba");
        mailSender.setDefaultEncoding("UTF-8");
        mailSender.setProtocol("smtps");
        return mailSender;
    }

    //    @Bean("netEasyMailSender")
//    public MailSender netEasyMailSender() {
//        JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
//        mailSender.setHost("smtp.163.com");
//        mailSender.setPort(465);
//        mailSender.setUsername("15900497661@163.com");
//        mailSender.setPassword("FBWZYILTYDRHEKUS");
//        mailSender.setDefaultEncoding("UTF-8");
//        mailSender.setProtocol("smtps");
//        return mailSender;
//    }


}
